/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yy.bugzillahelp.data;

import java.util.ArrayList;

/**
 *
 * @author Alan
 */
public class ProductData {

    private String id;
    private String name;
    private String desc;
    private boolean active;
    private boolean allowsUnconfirmed;
    private ArrayList<ComponentData> components = new ArrayList<ComponentData>();
    private ArrayList<VersionData> versions = new ArrayList<VersionData>();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public boolean isAllowsUnconfirmed() {
        return allowsUnconfirmed;
    }

    public void setAllowsUnconfirmed(boolean allowsUnconfirmed) {
        this.allowsUnconfirmed = allowsUnconfirmed;
    }

    public ArrayList<ComponentData> getComponents() {
        return components;
    }

    public void setComponents(ArrayList<ComponentData> componentDatas) {
        this.components = componentDatas;
    }

    public void addComponent(ComponentData componentData) {
        components.add(componentData);
    }

    public ArrayList<VersionData> getVersions() {
        return versions;
    }

    public void setVersions(ArrayList<VersionData> versions) {
        this.versions = versions;
    }

    public void addVersion(VersionData versionData) {
        versions.add(versionData);
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 79 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ProductData other = (ProductData) obj;
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ProductData{"
                + "\nid=" + id + ", name=" + name + ", desc=" + desc + ", active=" + active + ", allowsUnconfirmed=" + allowsUnconfirmed
                + "\ncomponents=" + components
                + "\nversions=" + versions
                + "\n}";
    }
}
